<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 运营中心激励金统计用户 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\RunExciteMoneyBillUser.name", default="fa_run_excite_money_bill_user"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\RunExciteMoneyBillUser.poolName"))
 * @DDL(sql="CREATE TABLE `fa_run_excite_money_bill_user` (
  `id` bigint(16) unsigned NOT NULL AUTO_INCREMENT,
  `run_id` int(10) DEFAULT NULL COMMENT '运营中心',
  `year` int(4) unsigned DEFAULT NULL COMMENT '年',
  `m` varchar(2) DEFAULT NULL COMMENT '月',
  `day` varchar(2) DEFAULT NULL COMMENT '天',
  `date` datetime DEFAULT NULL COMMENT '日期',
  `time` bigint(16) unsigned DEFAULT NULL COMMENT '时间',
  `updatetime` bigint(16) unsigned DEFAULT NULL COMMENT '更新时间',
  `user_id` int(10) DEFAULT NULL COMMENT '用户id',
  `status` enum('run','sys') NOT NULL DEFAULT 'run' COMMENT '状态:sys=系统添加,run=运营中心添加',
  `bonus_ratio` decimal(7,4) DEFAULT '0.0000' COMMENT '分配占比',
  `bonus` decimal(12,2) DEFAULT '0.00' COMMENT '当前收益',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='运营中心激励金统计用户'", decode="")
 *
 * @property int|null $id 
 * @property int|null $runId 运营中心
 * @property int|null $year 年
 * @property string|null $m 月
 * @property string|null $day 天
 * @property string|null $date 日期
 * @property int|null $time 时间
 * @property int|null $updatetime 更新时间
 * @property int|null $userId 用户id
 * @property string|null $status 状态:sys=系统添加,run=运营中心添加
 * @property string|float|int|null $bonusRatio 分配占比
 * @property string|float|int|null $bonus 当前收益
 */
abstract class RunExciteMoneyBillUserBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * id.
     * @Column(name="id", type="bigint", length=16, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 运营中心.
     * run_id
     * @Column(name="run_id", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $runId = NULL;

    /**
     * 获取 runId - 运营中心.
     *
     * @return int|null
     */
    public function getRunId(): ?int
    {
        return $this->runId;
    }

    /**
     * 赋值 runId - 运营中心.
     * @param int|null $runId run_id
     * @return static
     */
    public function setRunId($runId)
    {
        $this->runId = null === $runId ? null : (int)$runId;
        return $this;
    }

    /**
     * 年.
     * year
     * @Column(name="year", type="int", length=4, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $year = NULL;

    /**
     * 获取 year - 年.
     *
     * @return int|null
     */
    public function getYear(): ?int
    {
        return $this->year;
    }

    /**
     * 赋值 year - 年.
     * @param int|null $year year
     * @return static
     */
    public function setYear($year)
    {
        $this->year = null === $year ? null : (int)$year;
        return $this;
    }

    /**
     * 月.
     * m
     * @Column(name="m", type="varchar", length=2, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $m = NULL;

    /**
     * 获取 m - 月.
     *
     * @return string|null
     */
    public function getM(): ?string
    {
        return $this->m;
    }

    /**
     * 赋值 m - 月.
     * @param string|null $m m
     * @return static
     */
    public function setM($m)
    {
        $this->m = null === $m ? null : (string)$m;
        return $this;
    }

    /**
     * 天.
     * day
     * @Column(name="day", type="varchar", length=2, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $day = NULL;

    /**
     * 获取 day - 天.
     *
     * @return string|null
     */
    public function getDay(): ?string
    {
        return $this->day;
    }

    /**
     * 赋值 day - 天.
     * @param string|null $day day
     * @return static
     */
    public function setDay($day)
    {
        $this->day = null === $day ? null : (string)$day;
        return $this;
    }

    /**
     * 日期.
     * date
     * @Column(name="date", type="datetime", length=0, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $date = NULL;

    /**
     * 获取 date - 日期.
     *
     * @return string|null
     */
    public function getDate(): ?string
    {
        return $this->date;
    }

    /**
     * 赋值 date - 日期.
     * @param string|null $date date
     * @return static
     */
    public function setDate($date)
    {
        $this->date = null === $date ? null : (string)$date;
        return $this;
    }

    /**
     * 时间.
     * time
     * @Column(name="time", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $time = NULL;

    /**
     * 获取 time - 时间.
     *
     * @return int|null
     */
    public function getTime(): ?int
    {
        return $this->time;
    }

    /**
     * 赋值 time - 时间.
     * @param int|null $time time
     * @return static
     */
    public function setTime($time)
    {
        $this->time = null === $time ? null : (int)$time;
        return $this;
    }

    /**
     * 更新时间.
     * updatetime
     * @Column(name="updatetime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $updatetime = NULL;

    /**
     * 获取 updatetime - 更新时间.
     *
     * @return int|null
     */
    public function getUpdatetime(): ?int
    {
        return $this->updatetime;
    }

    /**
     * 赋值 updatetime - 更新时间.
     * @param int|null $updatetime updatetime
     * @return static
     */
    public function setUpdatetime($updatetime)
    {
        $this->updatetime = null === $updatetime ? null : (int)$updatetime;
        return $this;
    }

    /**
     * 用户id.
     * user_id
     * @Column(name="user_id", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $userId = NULL;

    /**
     * 获取 userId - 用户id.
     *
     * @return int|null
     */
    public function getUserId(): ?int
    {
        return $this->userId;
    }

    /**
     * 赋值 userId - 用户id.
     * @param int|null $userId user_id
     * @return static
     */
    public function setUserId($userId)
    {
        $this->userId = null === $userId ? null : (int)$userId;
        return $this;
    }

    /**
     * 状态:sys=系统添加,run=运营中心添加.
     * status
     * @Column(name="status", type="enum", length=0, accuracy=0, nullable=false, default="run", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $status = 'run';

    /**
     * 获取 status - 状态:sys=系统添加,run=运营中心添加.
     *
     * @return string|null
     */
    public function getStatus(): ?string
    {
        return $this->status;
    }

    /**
     * 赋值 status - 状态:sys=系统添加,run=运营中心添加.
     * @param string|null $status status
     * @return static
     */
    public function setStatus($status)
    {
        $this->status = null === $status ? null : (string)$status;
        return $this;
    }

    /**
     * 分配占比.
     * bonus_ratio
     * @Column(name="bonus_ratio", type="decimal", length=7, accuracy=4, nullable=true, default="0.0000", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $bonusRatio = NULL;

    /**
     * 获取 bonusRatio - 分配占比.
     *
     * @return string|float|int|null
     */
    public function getBonusRatio()
    {
        return $this->bonusRatio;
    }

    /**
     * 赋值 bonusRatio - 分配占比.
     * @param string|float|int|null $bonusRatio bonus_ratio
     * @return static
     */
    public function setBonusRatio($bonusRatio)
    {
        $this->bonusRatio = null === $bonusRatio ? null : $bonusRatio;
        return $this;
    }

    /**
     * 当前收益.
     * bonus
     * @Column(name="bonus", type="decimal", length=12, accuracy=2, nullable=true, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $bonus = NULL;

    /**
     * 获取 bonus - 当前收益.
     *
     * @return string|float|int|null
     */
    public function getBonus()
    {
        return $this->bonus;
    }

    /**
     * 赋值 bonus - 当前收益.
     * @param string|float|int|null $bonus bonus
     * @return static
     */
    public function setBonus($bonus)
    {
        $this->bonus = null === $bonus ? null : $bonus;
        return $this;
    }

}
